package models;

import java.sql.ResultSet;
import java.sql.SQLException;

public class 
StoreModel 
extends AbstractModel
{	public boolean
	insert(String sname, String address, String type)
	{	try{
			ps = con.prepareStatement("INSERT INTO Store VALUES (?,?,?)");
			ps.setString(1, sname);
			ps.setString(2, address);
			ps.setString(3, type.toUpperCase());
			return wrapUp();
		} 
		catch(SQLException ex)
		{ 
			return registerException(ex); 
		}
	}
	
	public boolean delete(String sname)
	{ 	
		try
		{
			ps = con.prepareStatement("DELETE FROM Store WHERE sname = ?");
			ps.setString(1, sname);
			return wrapUp();
		} 
		catch(SQLException ex)
		{ 
			return registerException(ex); 
		}
	}
	
	public ResultSet show()
	{ 
		return super.show("Store"); 
	}
}
